package com.zt.event.event.listener;

import com.zt.event.enums.ApplicationStatusEnums;
import com.zt.event.event.event.CustomsApplicationContextInitializedEvent;
import com.zt.event.service.status.listener.DefaultListenerProcess;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;

/**
 * @author system
 * 上下文环境初始化
 */
@Slf4j
public class ServiceContextInitializedListener extends DefaultListenerProcess implements ApplicationListener<CustomsApplicationContextInitializedEvent>{

    @Override
    public void onApplicationEvent(CustomsApplicationContextInitializedEvent event) {
        log.info("上下文环境初始化....");
        String response = defaultHandleMessage(ApplicationStatusEnums.CONTEXT_INITIALIZED, "无", context, event.getCostTime());
        if (response == null) {
            log.info("NOTICE_URL 参数为空, 不参与发送");
        } else {

            log.info("send success data:{}", response);
        }
    }
}
